

import 'package:flutter/material.dart';
import '../model/details.dart';
// import '../config/serivcie_url.dart';
// import '../provide/details_info.dart';
import '../service/service_method.dart';
import 'dart:convert';


class DetailsProviedInfo  with ChangeNotifier {
  
  DetailsModel goodsInfo;
  bool isLeft = true;
  bool isRight = false; 
  // 从后台获取商品数据
  getGoodsInfo(String id) async{
    var formData = {'goodId':id};
    await request('getGoodDetailById',formData:formData).then((val){
        var response = json.decode(val.toString());
        goodsInfo = DetailsModel.fromJson(response);
        notifyListeners();
    });
  } 

  // tabbar的切换
  changeTabbar(String changeState){
    if(changeState=='left'){
      isLeft = true;
      isRight = false; 
    }else{
      isLeft = false;
      isRight = true; 
    }
    notifyListeners();
  }
}